<?php
/*
Plugin Name: College Press
Plugin URI: http://www.collegepress.net
Version: 0.1
Author: The College Press Project 
Description: A plugin and theme suite that adds functionality specifically for college newspapers online.
*/

include 'php/collegepress_menu_home.php';
include 'php/collegepress_admin_post.php';
include 'php/collegepress_lightbox.php';



if (!class_exists("CollegePress")){

class CollegePress {
	 
	var $cpa;
	var $adminOptionsName = "CollegePressAdminOptions";
	// the $cpa variable holds all of the info that the admin has set
	

	function CollegePress(){
		//empty constructor, duh
	}

	function init() {
		/* Empty function for now, but we might need it later */
	}
	
	function collegePressHeader() {
		$cp_Options = get_option($adminOptionsName);
		if ($cp_Options['enableLightbox'] == "true") {
		?>
			<!-- BEGIN College Press Includes -->
			<!-- TODO smart plugin directory -->
			<script type="text/javascript" src="wp-content/plugins/collegepress/js/prototype.js"></script>
			<script type="text/javascript" src="wp-content/plugins/collegepress/js/scriptaculous.js?load=effects,builder"></script>
			<script type="text/javascript" src="wp-content/plugins/collegepress/js/lightbox.js"></script>
			<link rel="stylesheet" href="wp-content/plugins/collegepress/css/lightbox.css" type="text/css" media="screen" />
			<!-- END College Press Includes -->
		<?php
		} //END Lightbox Includes if
	}
	

	
} //End CollegePress
} //end CollegePress class_exist check



if (class_exists("CollegePress")) {
        $cp_Plugin = new CollegePress();
}

//$cpa = new CollegePressAdminMenu();

//Actions and Filters
if (isset($cp_Plugin)){
	//Initializing our College Press objects.
	//global these if you need them in another file
	$cpAdmin = new CollegePressAdminMenu();
	$cpPost = new CollegePressPostOptions();
	
	//Actions
	add_action('activate_collegepress/collegepress.php', array(&$cp_Plugin, 'init')); //initialize
	add_action('wp_head', array(&$cp_Plugin, 'collegePressHeader'), 1);
	
	
	add_action('admin_menu', array(&$cpAdmin, 'CollegePress_ap'));


	/* Write->Post Options */
	
	/*add_action('simple_edit_form', array(&$cpPost, 'cpPostForm'));
	add_action('edit_form_advanced', array(&$cpPost, 'cpPostForm'));
	add_action('save_post', array(&$cpPost, 'cpPostForm'));
	add_action('edit_post',  array(&$cpPost, 'cpPostForm'));
	*/
	//Filters
	
	add_filter('the_content', 'wp_lightbox2_replace');
}

?>
